package src.ee.ioc.smaug.ui.evolver;



import javax.swing.BorderFactory;
import javax.swing.JEditorPane;
import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import java.awt.Dimension;
import javax.swing.JPanel;

public class WEvolver extends JInternalFrame {
    TrParameter treePane = new TrParameter();
    PControlsEvolver pc = new PControlsEvolver();
    JEditorPane mainPanel = new JEditorPane();
    JEditorPane bottomPanel = new JEditorPane();
    
    private JPanel mTopPanel=new JPanel();

    public WEvolver() {
        super("Evolver", true, //resizable
                true, //closable
                true, //maximizable
                true);//iconifiable
        setSize(900, 800);
        setLocation(20, 20);
        setLayout(null);

        //Top panel 
        mTopPanel.setSize(900, 505);
        mTopPanel.setLayout(null);
        
        //Tree pane
        treePane.setOpaque(true);
        treePane.setBounds(5, 5, 350, 500);
        mTopPanel.add(treePane);
        //Controls pane
        pc.setOpaque(true);
        pc.setBounds(360, 5, 525, 40);
        mTopPanel.add(pc);

       //Main panel
        mainPanel.setBounds(360, 50, 523, 455);
        mainPanel.setEditable(false);
    
        JScrollPane mainPanelScroll = new JScrollPane(mainPanel);
        mainPanelScroll.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder("Results"),
                BorderFactory.createEmptyBorder(1,1,1,1)));  
        mainPanelScroll.setBounds(360, 50, 525, 455);

        mTopPanel.add(mainPanelScroll);
        mTopPanel.setVisible(true);
     

        Dimension minimumSize = new Dimension(900, 50);
        mTopPanel.setMinimumSize(minimumSize);
       
        
        bottomPanel.setBounds(5, 510, 878, 250);
        bottomPanel.setEditable(false);

        JScrollPane bottomPanelScroll = new JScrollPane(bottomPanel);
        
        bottomPanelScroll.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder("Trace"),
                BorderFactory.createEmptyBorder(1,1,1,1)));

        bottomPanelScroll.setBounds(5, 510, 880, 250);
        bottomPanelScroll.setMinimumSize(minimumSize);
        bottomPanelScroll.setVisible(true);
        
        //Split pane
        JSplitPane   splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                mTopPanel, bottomPanelScroll);
        splitPane.setOneTouchExpandable(true);
        splitPane.setDividerLocation(505);

        splitPane.setSize(890, 770);
        splitPane.setVisible(true);
        add(splitPane);

        this.setVisible(true);


    }

}
